#%%
from ChartReport.Report import Report
from ChartReport.Content import MatplotlibFigureContent
import matplotlib.pyplot as plt
import pandas as pd
import json
from io import BytesIO

#%%
def set_marks(objs,col,values):
    vs = (
        {'name':col,'value': v}
        for v in values
    )
    for obj,v in zip(objs,vs):
        plt.setp(obj,'gid',f'__mpl-data_{json.dumps(v)}')




fig1, ax = plt.subplots()
X = 'a b c d e'.split(' ')
height = [5, 20, 15, 25, 5]
bars = ax.bar(X, height, width=0.6)

# set_marks(bars,'col1',height)


Report().add_row(fig1).to_html('result.html')
